package com.neusoft.EYSystem.controller;

import com.neusoft.EYSystem.po.*;
import com.neusoft.EYSystem.service.MealpickService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/mealpick")
public class MealpickController {
    @Autowired
    private MealpickService mealpickService;

    // 健康管家端 膳食管理 膳食安排 表格显示
    // 查询所有人的膳食安排
    @GetMapping("/pageMealpick")
    public PageResponseBean<List<Mealpick>> pageMealpick(Long cur, Long number, Client client,Mealpick mealpick) {
        return null;
    }
    // 健康管家端 膳食管理 查看客户膳食安排
    @GetMapping("/pageClientAndScheduleAndItem")
    public PageResponseBean<List<ClientAndScheduleAndItem>> pageClientAndScheduleAndItem(Long cur, Long number, Client client, MealSchedule mealSchedulel, Mealitem mealitem) {
        return mealpickService.pageClientAndScheduleAndItem(cur, number, client, mealSchedulel, mealitem);
    }
    // 健康管家端 膳食管理 膳食安排 点击新建膳食安排 进入 右表格显示
    // 查询某人的膳食安排中这一膳食日期已包含的膳食项目
    @GetMapping("/getIncludedMeal")
    public PageResponseBean<List<Mealitem>> getIncludedMeal(Long cur, Long number, Client client,MealSchedule mealSchedule) {
        return mealpickService.getIncludedMeal(cur, number, client, mealSchedule);
    }
    // 健康管家端 膳食管理 膳食安排 点击新建膳食安排 进入 左表格显示
    // 查询某人的膳食安排中这一膳食日期未包含的膳食项目
    @GetMapping("/getExcludedProjects")
    public PageResponseBean<List<Mealitem>> getExcludedProjects(Long cur, Long number,Client client,MealSchedule mealSchedulel) {
        return mealpickService.getExcludedProjects(cur, number, client, mealSchedulel);
    }

    // 健康管家端 膳食管理 膳食安排 未选膳食表添加按钮
    @PostMapping("/addMealpickService")
    public ResponseBean<Integer> addMealpickService(Client client,MealSchedule mealSchedule, Mealitem mealitem) {
        return mealpickService.addMealpickService(client, mealSchedule, mealitem);
    }

    // 健康管家端 膳食管理 膳食安排 已选膳食表删除按钮
    @PostMapping("/removeMealpickService")
    public ResponseBean<Integer> removeProjectFromLevel(Client client,MealSchedule mealSchedule, Mealitem mealitem) {
        return mealpickService.removeMealpickService(client, mealSchedule, mealitem);
    }
}
